// api/index.ts
import request from '@/utils/request';

// 获取用户列表
export const getUserList = (params: { page: number; size: number }): Promise<User[]> => {
  return request.get('/users', { params });
};

// 创建用户
export const createUser = (userData: User): Promise<User> => {
  return request.post('/users', userData);
};

// 更新用户
export const updateUser = (id: string, userData: User): Promise<User> => {
  return request.put(`/users/${id}`, userData);
};

// 删除用户
export const deleteUser = (id: string): Promise<void> => {
  return request.delete(`/users/${id}`);
};